import http from "../request";
export default {
	//注册接口
	registerUser(params) {
		return http.post("/user/registerUser", params)
	},
	//登录接口
	login(params) {
		return http.post("/user/login", params)
	},
	//修改用户信息
	updateUser(params) {
		return http.post("/user/updateUser", params, true)
	},
	//上传头像
	uploadAvatar(params) {
		return http.uploadFile("/user/uploadAvatar", params)
	},
	//获取当前登录用户信息
	getUserInfo() {
		return http.get("/user/userInfo", {}, true)
	},
	//退出登录
	logout() {
		return http.get("/user/logout", {}, true)
	},
	//验证用户手机号是否存在
	validatePhone(params) {
		return http.get("/user/validatePhone", params)
	},
	//获取验证码（登录）
	verifyCode(params) {
		return http.get("/user/verifyCode", params)
	},
	//获取验证码（注册）
	verifyRegisterCode(params) {
		return http.get("/user/verifyRegisterCode", params)
	},
	//重置密码
	resetPassword(params) {
		return http.post("/user/resetPassword", params)
	},
	//登录接口
	phoneLogin(params) {
		return http.post("/user/phoneLogin", params)
	},
	//去登录
	toLogin() {
		uni.navigateTo({
			url: '/pages/user/login'
		})
	}
}